from enum import StrEnum

from pydantic import BaseModel


class ServerEventType(StrEnum):
    ResponseAudioDelta = "response.audio.delta"
    ResponseDone = "response.done"
    InputAudioBufferSpeechStarted = "input_audio_buffer.speech_started"


class ServerEvent(BaseModel):
    event_id: str = None
    type: ServerEventType | str


class ResponseDelta(ServerEvent):
    content_index: int
    delta: str
    item_id: str
    output_index: int
    response_id: str
